package com.carleasoft.mps.cms.business.user.controller;

import com.carleasoft.mps.cms.business.user.bean.po.UserSkillPo;
import com.carleasoft.mps.cms.business.user.bean.vo.*;
import com.carleasoft.mps.cms.business.user.service.UserSkillService;
import com.carleasoft.mps.core.result.R;
import com.carleasoft.mps.core.utils.IBeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: yangHao
 * @createDate:2023/6/15
 * @description:
 */
@RestController
@RequestMapping("eipSkill")
public class EipController {

    @Autowired
    private UserSkillService userSkillService;

    /**
     * 根据部门编码查询人才分类
     *
     * @return
     */
    @PostMapping("/skillTypeList")
    public R skillTypeList(@RequestBody UserSkillPo userSkillPo) {
        SkillTypeListVo skillTypeListVo = userSkillService.skillTypeList(userSkillPo);
        return R.ok(skillTypeListVo);
    }


    /**
     * 专业技术能手
     *
     * @param userSkillPo
     * @return
     */
    @PostMapping("/technology")
    public R technology(@RequestBody UserSkillPo userSkillPo) {
        TechnologyVo technology = userSkillService.technology(userSkillPo);
        return R.ok(technology);
    }


    /**
     * 身高体重分布统计
     */
    @PostMapping("/heightAndWeight")
    public R heightAndWeight(@RequestBody UserSkillPo userSkillPo) {
        HeightAndWeightVo heightAndWeightVo = userSkillService.heightAndWeight(userSkillPo);
        return R.ok(heightAndWeightVo);
    }


    /**
     * 职业技能鉴定统计
     *
     * @param userSkillPo
     * @return
     */
    @PostMapping("/skill")
    public R skill(@RequestBody UserSkillPo userSkillPo) {
        SkillVo skillVo = userSkillService.skill(userSkillPo);
        return R.ok(skillVo);
    }

    /**
     * 年龄统计
     *
     * @param userSkillPo
     * @return
     */
    @PostMapping("/ageCount")
    public R ageCount(@RequestBody UserSkillPo userSkillPo) {
        AgeCountVo ageCountVo = userSkillService.ageCount(userSkillPo);
        return R.ok(ageCountVo);
    }


    /**
     * 婚姻状况统计
     *
     * @param userSkillPo
     * @return
     */
    @PostMapping("/marriage")
    public R marriage(@RequestBody UserSkillPo userSkillPo) {
        MarriageVo marriageVo = userSkillService.marriage(userSkillPo);
        return R.ok(marriageVo);
    }

    /**
     * 学历统计
     *
     * @param userSkillPo
     * @return
     */
    @PostMapping("/educationCount")
    public R educationCount(@RequestBody UserSkillPo userSkillPo) {
        EducationCountVo educationCountVo = userSkillService.educationCount(userSkillPo);
        return R.ok(educationCountVo);
    }

    /**
     * 指挥技能统计
     *
     * @param userSkillPo
     * @return
     */
    @PostMapping("/commandCount")
    public R commandCount(@RequestBody UserSkillPo userSkillPo) {
        SkillVo skillVo = userSkillService.commandCount(userSkillPo);
        return R.ok(skillVo);
    }

    /**
     * 查询人数
     *
     * @return
     */
    @PostMapping("/userCount")
    public R userCount() {
        UserCountVo userCountVo = userSkillService.userCount();
        return R.ok(userCountVo);
    }


    /**
     * 单位统计
     *
     * @return
     */
    @PostMapping("/deptCount")
    public R deptCount(@RequestBody UserSkillPo userSkillPo) {
        List<DeptCountVo> deptCountVos = userSkillService.deptCount(userSkillPo);
        return R.ok(deptCountVos);
    }


}
